package com.edu.exam.enums.assessment;

import com.edu.exam.enums.core.BaseEnum;

/**
 * 查重推荐类型枚举
 */
public enum CheckRecommendationType implements BaseEnum {
    DUPLICATE("DUPLICATE", "重复试题"),
    SIMILAR("SIMILAR", "相似试题"),
    MODIFY("MODIFY", "建议修改"),
    REVIEW("REVIEW", "建议人工审核");

    private final String code;
    private final String description;

    CheckRecommendationType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public static CheckRecommendationType fromCode(String code) {
        for (CheckRecommendationType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return DUPLICATE; // 默认返回重复试题
    }
}